package com.drools.drools.chapter8;

import com.drools.drools.BaseTest;
import com.drools.drools.model.Person;
import org.junit.Test;
import org.kie.api.runtime.KieSession;

/**
 * Created with IntelliJ IDEA.
 * User: mishuai
 * Date: 2019-04-27
 * Time: 11:41
 * Des:
 */
public class LockOnActive extends BaseTest {

    @Test
    public void lockOnActive(){

        KieSession kieSession= this.getKieSessionBySessionName("lock-on-active-rules");
        Person person=new Person(19);
        kieSession.insert(person);
        kieSession.fireAllRules();
        System.out.println(person.getAge());
        kieSession.dispose();
    }
}
